package com.example.administrator.okgodemo;

import android.app.Application;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.cache.CacheEntity;
import com.lzy.okgo.cache.CacheMode;

public class OkGoApplication extends Application{
    @Override
    public void onCreate() {
        super.onCreate();
        OkGo.getInstance()
                .init(this)
                .setCacheMode(CacheMode.NO_CACHE)//设置缓存模式
                .setCacheTime(CacheEntity.CACHE_NEVER_EXPIRE)//设置缓存时间,默认永不过期
                .setRetryCount(3);//请求超时重连次数,默认3次
        OkGo.getInstance().init(this);
    }


}
